package cn.virens.web.components.shiro.oauth2;

import org.apache.shiro.authc.AuthenticationToken;

public class Oauth2AuthenticationToken implements AuthenticationToken {
	private static final long serialVersionUID = -9060028707442133410L;

	private String code;
	private String state;
	private String redirectUri;

	public String getCode() {
		return code;
	}

	public void setCode(String authCode) {
		this.code = authCode;
	}

	public String getState() {
		return state;
	}

	public void setState(String authState) {
		this.state = authState;
	}

	public String getRedirectUri() {
		return redirectUri;
	}

	public void setRedirectUri(String redirectUri) {
		this.redirectUri = redirectUri;
	}

	@Override
	public Object getPrincipal() {
		return getCode();
	}

	public void setPrincipal(String principal) {
		this.setCode(principal);
	}

	@Override
	public String getCredentials() {
		return getState();
	}

	public void setCredentials(String credentials) {
		this.setState(credentials);
	}

	@Override
	public String toString() {
		return "Oauth2AuthenticationToken [code=" + code + ", state=" + state + "]";
	}

}
